package ui.common
{
	import flash.display.Sprite;

	/**
	 * @author Administrator
	 */
	public class GridBase extends SpriteObject
	{
		public var cellArr:Array = [];
		
		public function GridBase()
		{
			initChilds();
		}
		
		protected function initChilds():void
		{
			var i:int;
			var cell:CellBase;
			
			for(i=0; i<cellCount; i++)
			{
				cell = getChildByName("mcCell"+i.toString()) as CellBase;
				if(cell)
				{
					cellArr.push(cell);
				}
			}
		}
		
		protected function get cellCount():int
		{
			return 0;
		}
		
		public function get length():int
		{
			return cellArr.length;
		}
		
		public function getAt(i:int):CellBase
		{
			return cellArr[i] as CellBase;
		}
	}
}
